package com.candy.thread;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author donglin
 * @Title:
 * @类名: Mythread
 * @date 2020/5/29
 */
public class Mythread extends Thread{
    SimpleDateFormat fm=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    @Override
    public void run() {
        for (int i = 0; i <10 ; i++) {
            System.out.println(fm.format(new Date()));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
